home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
buttons
/
toolb160
/
sample
/
document.frm
< prev
next >
Wrap
Text File
|
1994-09-05
|
3KB
|
109 lines
VERSION 2.00
Begin Form frmDocument
Caption = "Untitled"
ClientHeight = 4665
ClientLeft = 1095
ClientTop = 1485
ClientWidth = 7860
Height = 5070
Left = 1035
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 4665
ScaleWidth = 7860
Top = 1140
Width = 7980
Begin TextBox txtDocument
BorderStyle = 0 'None
Height = 1995
HideSelection = 0 'False
Left = 600
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 0
Top = 300
Width = 2775
End
Begin Label lblAction
AutoSize = -1 'True
Caption = "lblAction"
Height = 195
Left = 3660
TabIndex = 1
Top = 180
Visible = 0 'False
Width = 750
End
End
Option Explicit
Dim mbChanged As Integer
Sub Form_Activate ()
Dim I As Integer
CheckEditMenu
For I = 0 To frmMain!cboFontNames.ListCount - 1
If frmMain!cboFontNames.List(I) = Me.FontName Then
frmMain!cboFontNames.ListIndex = I
Exit For
End If
Next I
For I = 0 To frmMain!cboFontSizes.ListCount - 1
If CInt(Val(frmMain!cboFontSizes.List(I))) = Me.FontSize Then
frmMain!cboFontSizes.ListIndex = I
Exit For
End If
Next I
End Sub
Sub Form_Resize ()
On Local Error Resume Next
txtDocument.Move 0, 0, Me.Width - 100, Me.Height - 390
End Sub
Sub Form_Unload (Cancel As Integer)
CheckEditMenu
If mbChanged Then
If MsgBox(Me.Caption + Chr$(13) + Chr$(10) + "This file has changed. Save?", 36) = 6 Then
Set gcForm = Me
frmMain!lblAction.Caption = "save"
Set gcForm = Nothing
If mbChanged Then Cancel = True
End If
End If
End Sub
Sub lblAction_Change ()
Dim sTmp As String
If lblAction.Caption = "" Then Exit Sub
If InStr(lblAction.Caption, "set changed") = 1 Then
sTmp = Trim$(Mid$(lblAction.Caption, InStr(lblAction.Caption, "=") + 1))
If sTmp = "false" Then
mbChanged = False
Else
mbChanged = True
End If
lblAction.Caption = ""
End If
If InStr(lblAction.Caption, "get findposition") = 1 Then
lblAction.Caption = Format$(txtDocument.SelStart)
End If
End Sub
Sub txtDocument_Change ()
mbChanged = True
CheckEditMenu
End Sub
Sub txtDocument_Click ()
CheckEditMenu
End Sub
Sub txtDocument_KeyUp (KeyCode As Integer, Shift As Integer)
CheckEditMenu
End Sub
Sub txtDocument_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
CheckEditMenu
End Sub